#include "app_message.h"
#include "log/log.h"
int main(int argc, char *argv[])
{
    //定义json字符串{conn_type:1,id:"5858",msg:"61626364"}
    char *json = "{\"conn_type\":1,\"id\":\"5858\",\"msg\":\"61626364\"}";
    char chars[100];
    //json转换为字符
    int len = app_message_json2chars(json, chars, 100);
    log_debug("chars: %.*s, len: %d",len, chars, len);

    //字符串转换json
    char *json2 = app_message_chars2json(chars, len);
    log_debug("json2: %s", json2);
    return 0;
}